package com.empire.module.member.dal.mysql.locationlast;

import java.util.*;

import com.empire.framework.common.pojo.PageResult;
import com.empire.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.empire.framework.mybatis.core.mapper.BaseMapperX;
import com.empire.module.member.dal.dataobject.locationlast.LocationLastDO;
import org.apache.ibatis.annotations.Mapper;
import com.empire.module.member.controller.admin.locationlast.vo.*;

/**
 * 定位信息 Mapper
 *
 * @author 主席大人
 */
@Mapper
public interface LocationLastMapper extends BaseMapperX<LocationLastDO> {

    default PageResult<LocationLastDO> selectPage(LocationLastPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LocationLastDO>()
                .betweenIfPresent(LocationLastDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(LocationLastDO::getLocationTime, reqVO.getLocationTime())
                .eqIfPresent(LocationLastDO::getLng, reqVO.getLng())
                .eqIfPresent(LocationLastDO::getLat, reqVO.getLat())
                .eqIfPresent(LocationLastDO::getAddress, reqVO.getAddress())
                .eqIfPresent(LocationLastDO::getDataType, reqVO.getDataType())
                .eqIfPresent(LocationLastDO::getCameraNo, reqVO.getCameraNo())
                .eqIfPresent(LocationLastDO::getFaceUrl, reqVO.getFaceUrl())
                .orderByDesc(LocationLastDO::getId));
    }

}